<template>
  <div class="main" :key="HistogramLegend">
    <el-tabs>
      <div class="chartsStyle">
        <div class="chart-title">

          <tr style="height: 30px;">
            <td><span class="nature">背景颜色</span></td>
            <td>
              <el-color-picker v-model="backgroundColor" show-alpha size="mini"></el-color-picker>
            </td>
          </tr>
          <br/>

          <tr style="height: 30px;">
            <td><span class="nature">标签颜色</span></td>
            <td>
              <el-color-picker v-model="color" show-alpha size="mini"></el-color-picker>
            </td>
          </tr>

          <br/>
          <tr style="height: 30px;">
            <td><span class="nature">分割线颜色</span></td>
            <td>
              <el-color-picker v-model="splitLineColor" show-alpha size="mini"></el-color-picker>
            </td>
          </tr>
          <br/>

          <tr style="height: 30px;">
            <td><span class="nature">数据线颜色</span></td>
            <td>
              <el-color-picker v-model="dataLineColor" show-alpha size="mini"></el-color-picker>
            </td>
          </tr>
          <br/>
          <tr>
            <td><span class="nature">标签大小</span></td>
            <td>
              <el-input-number v-model="fontSize" @change="setFontSize" :min="7" :max="20"  size="small" >
              </el-input-number>
            </td>
          </tr>
          <br/>

          <tr>
            <td><span class="nature">雷达图形状</span></td>
            <td>
              <el-select  v-model="shape" clearable placeholder="请选择" size="mini" style="width: 180px">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </td>
          </tr>
          <br/>

          <tr>
            <td><span class="nature">数据线类型</span></td>
            <td>
              <el-select v-model="lineType" clearable placeholder="请选择" size="mini" style="width: 180px">
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </td>
          </tr>
          <br/>

        </div>
      </div>
    </el-tabs>
  </div>
</template>

<script>

export default {
  data () {
    return {
      backgroundColor: '#d2dde6', // 背景颜色
      shape: 'polygon', // 雷达图形状 'polygon' 和 'circle'
      color: '#000', // 标签颜色
      fontSize: 8, // 标签大小
      splitLineColor: '#3f3ce6', // 分割线颜色
      dataLineColor: '#000', // 数据线颜色
      lineType: 'solid', // 数据线虚实 'dashed',  'solid'

      options: [{
        value: 'polygon',
        label: '多边形'
      }, {
        value: 'circle',
        label: '圆形'
      }],
      options2: [{
        value: 'dashed',
        label: '虚线'
      }, {
        value: 'solid',
        label: '实线'
      }]
    }
  },
  methods: {
    setSymbolSize (value) {
      this.$store.state.treeLegend.symbolSize = value
    },
    setFontSize (val) {
      this.$store.state.radarLegend.fontSize = val
    }
  },
  watch: {
    backgroundColor (val) {
      this.$store.state.radarLegend.backgroundColor = val
    },
    splitLineColor (val) {
      this.$store.state.radarLegend.splitLineColor = val
    },
    color (val) {
      this.$store.state.radarLegend.color = val
    },
    dataLineColor (val) {
      this.$store.state.radarLegend.dataLineColor = val
      console.log('设置的数据线颜色' + val)
    },
    shape (val) {
      this.$store.state.radarLegend.shape = val
    },
    lineType (val) {
      this.$store.state.radarLegend.lineType = val
    }

  }
}
</script>

<style lang="scss" scoped>
  .main{
    background-color: #E6E3E3;
  }
  .nature{
    font-size: 17px;
    font-weight:bold;

  }

</style>
